home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-01 | 8.5 KB | 409 lines | [TEXT/MPS ] |
- ;
- ; File: Palettes.a
- ;
- ; Contains: Palette Manager Interfaces.
- ;
- ; Version: Technology: System 7.5
- ; Release: Universal Interfaces 3.0d3 on Copland DR1
- ;
- ; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
- IF &TYPE('__PALETTES__') = 'UNDEFINED' THEN
- __PALETTES__ SET 1
-
- IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
- include 'Quickdraw.a'
- ENDIF
- IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
- include 'Windows.a'
- ENDIF
- IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
-
- pmCourteous EQU 0 ;Record use of color on each device touched.
- pmTolerant EQU $0002 ;render ciRGB if ciTolerance is exceeded by best match.
- pmAnimated EQU $0004 ;reserve an index on each device touched and render ciRGB.
- pmExplicit EQU $0008 ;no reserve, no render, no record; stuff index into port.
- pmWhite EQU $0010
- pmBlack EQU $0020
- pmInhibitG2 EQU $0100
- pmInhibitC2 EQU $0200
- pmInhibitG4 EQU $0400
- pmInhibitC4 EQU $0800
- pmInhibitG8 EQU $1000
- pmInhibitC8 EQU $2000 ; NSetPalette Update Constants
- pmNoUpdates EQU $8000 ;no updates
- pmBkUpdates EQU $A000 ;background updates only
- pmFgUpdates EQU $C000 ;foreground updates only
- pmAllUpdates EQU $E000 ;all updates
- ColorInfo RECORD 0
- ciRGB ds RGBColor ; offset: $0 (0) ; true RGB values
- ciUsage ds.w 1 ; offset: $6 (6) ; color usage
- ciTolerance ds.w 1 ; offset: $8 (8) ; tolerance value
- ciDataFields ds.w 3 ; offset: $A (10) ; private fields
- sizeof EQU * ; size: $10 (16)
- ENDR
- ; typedef struct ColorInfo * ColorInfoPtr
-
- ; typedef ColorInfoPtr * ColorInfoHandle
-
- Palette RECORD 0
- pmEntries ds.w 1 ; offset: $0 (0) ; entries in pmTable
- pmDataFields ds.w 7 ; offset: $2 (2) ; private fields
- pmInfo ds ColorInfo ; offset: $10 (16) <-- really an array of length one
- sizeof EQU * ; size: $20 (32)
- ENDR
- ; typedef struct Palette * PalettePtr
-
- ; typedef PalettePtr * PaletteHandle
-
- ;
- ; pascal void InitPalettes(void )
- ;
- IF ¬ GENERATINGCFM THEN
- _InitPalettes: OPWORD $AA90
- ELSE
- IMPORT_CFM_FUNCTION InitPalettes
- ENDIF
-
- ;
- ; pascal PaletteHandle NewPalette(short entries, CTabHandle srcColors, short srcUsage, short srcTolerance)
- ;
- IF ¬ GENERATINGCFM THEN
- _NewPalette: OPWORD $AA91
- ELSE
- IMPORT_CFM_FUNCTION NewPalette
- ENDIF
-
- ;
- ; pascal PaletteHandle GetNewPalette(short PaletteID)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetNewPalette: OPWORD $AA92
- ELSE
- IMPORT_CFM_FUNCTION GetNewPalette
- ENDIF
-
- ;
- ; pascal void DisposePalette(PaletteHandle srcPalette)
- ;
- IF ¬ GENERATINGCFM THEN
- _DisposePalette: OPWORD $AA93
- ELSE
- IMPORT_CFM_FUNCTION DisposePalette
- ENDIF
-
- ;
- ; pascal void ActivatePalette(WindowPtr srcWindow)
- ;
- IF ¬ GENERATINGCFM THEN
- _ActivatePalette: OPWORD $AA94
- ELSE
- IMPORT_CFM_FUNCTION ActivatePalette
- ENDIF
-
- ;
- ; pascal void SetPalette(WindowPtr dstWindow, PaletteHandle srcPalette, Boolean cUpdates)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetPalette: OPWORD $AA95
- ELSE
- IMPORT_CFM_FUNCTION SetPalette
- ENDIF
-
- ;
- ; pascal void NSetPalette(WindowPtr dstWindow, PaletteHandle srcPalette, short nCUpdates)
- ;
- IF ¬ GENERATINGCFM THEN
- _NSetPalette: OPWORD $AA95
- ELSE
- IMPORT_CFM_FUNCTION NSetPalette
- ENDIF
-
- ;
- ; pascal PaletteHandle GetPalette(WindowPtr srcWindow)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetPalette: OPWORD $AA96
- ELSE
- IMPORT_CFM_FUNCTION GetPalette
- ENDIF
-
- ;
- ; pascal void CopyPalette(PaletteHandle srcPalette, PaletteHandle dstPalette, short srcEntry, short dstEntry, short dstLength)
- ;
- IF ¬ GENERATINGCFM THEN
- _CopyPalette: OPWORD $AAA1
- ELSE
- IMPORT_CFM_FUNCTION CopyPalette
- ENDIF
-
- ;
- ; pascal void PmForeColor(short dstEntry)
- ;
- IF ¬ GENERATINGCFM THEN
- _PmForeColor: OPWORD $AA97
- ELSE
- IMPORT_CFM_FUNCTION PmForeColor
- ENDIF
-
- ;
- ; pascal void PmBackColor(short dstEntry)
- ;
- IF ¬ GENERATINGCFM THEN
- _PmBackColor: OPWORD $AA98
- ELSE
- IMPORT_CFM_FUNCTION PmBackColor
- ENDIF
-
- ;
- ; pascal void AnimateEntry(WindowPtr dstWindow, short dstEntry, const RGBColor *srcRGB)
- ;
- IF ¬ GENERATINGCFM THEN
- _AnimateEntry: OPWORD $AA99
- ELSE
- IMPORT_CFM_FUNCTION AnimateEntry
- ENDIF
-
- ;
- ; pascal void AnimatePalette(WindowPtr dstWindow, CTabHandle srcCTab, short srcIndex, short dstEntry, short dstLength)
- ;
- IF ¬ GENERATINGCFM THEN
- _AnimatePalette: OPWORD $AA9A
- ELSE
- IMPORT_CFM_FUNCTION AnimatePalette
- ENDIF
-
- ;
- ; pascal void GetEntryColor(PaletteHandle srcPalette, short srcEntry, RGBColor *dstRGB)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetEntryColor: OPWORD $AA9B
- ELSE
- IMPORT_CFM_FUNCTION GetEntryColor
- ENDIF
-
- ;
- ; pascal void SetEntryColor(PaletteHandle dstPalette, short dstEntry, const RGBColor *srcRGB)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetEntryColor: OPWORD $AA9C
- ELSE
- IMPORT_CFM_FUNCTION SetEntryColor
- ENDIF
-
- ;
- ; pascal void GetEntryUsage(PaletteHandle srcPalette, short srcEntry, short *dstUsage, short *dstTolerance)
- ;
- IF ¬ GENERATINGCFM THEN
- _GetEntryUsage: OPWORD $AA9D
- ELSE
- IMPORT_CFM_FUNCTION GetEntryUsage
- ENDIF
-
- ;
- ; pascal void SetEntryUsage(PaletteHandle dstPalette, short dstEntry, short srcUsage, short srcTolerance)
- ;
- IF ¬ GENERATINGCFM THEN
- _SetEntryUsage: OPWORD $AA9E
- ELSE
- IMPORT_CFM_FUNCTION SetEntryUsage
- ENDIF
-
- ;
- ; pascal void CTab2Palette(CTabHandle srcCTab, PaletteHandle dstPalette, short srcUsage, short srcTolerance)
- ;
- IF ¬ GENERATINGCFM THEN
- _CTab2Palette: OPWORD $AA9F
- ELSE
- IMPORT_CFM_FUNCTION CTab2Palette
- ENDIF
-
- ;
- ; pascal void Palette2CTab(PaletteHandle srcPalette, CTabHandle dstCTab)
- ;
- IF ¬ GENERATINGCFM THEN
- _Palette2CTab: OPWORD $AAA0
- ELSE
- IMPORT_CFM_FUNCTION Palette2CTab
- ENDIF
-
- ;
- ; pascal long Entry2Index(short entry)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _Entry2Index
- moveq #0,D0
- dc.w $AAA2
- EndM
- ELSE
- IMPORT_CFM_FUNCTION Entry2Index
- ENDIF
-
- ;
- ; pascal void RestoreDeviceClut(GDHandle gd)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _RestoreDeviceClut
- moveq #2,D0
- dc.w $AAA2
- EndM
- ELSE
- IMPORT_CFM_FUNCTION RestoreDeviceClut
- ENDIF
-
- ;
- ; pascal void ResizePalette(PaletteHandle p, short size)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _ResizePalette
- moveq #3,D0
- dc.w $AAA2
- EndM
- ELSE
- IMPORT_CFM_FUNCTION ResizePalette
- ENDIF
-
- ;
- ; pascal void SaveFore(ColorSpec *c)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SaveFore
- move.w #$040D,D0
- dc.w $AAA2
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SaveFore
- ENDIF
-
- ;
- ; pascal void SaveBack(ColorSpec *c)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SaveBack
- move.w #$040E,D0
- dc.w $AAA2
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SaveBack
- ENDIF
-
- ;
- ; pascal void RestoreFore(const ColorSpec *c)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _RestoreFore
- move.w #$040F,D0
- dc.w $AAA2
- EndM
- ELSE
- IMPORT_CFM_FUNCTION RestoreFore
- ENDIF
-
- ;
- ; pascal void RestoreBack(const ColorSpec *c)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _RestoreBack
- move.w #$0410,D0
- dc.w $AAA2
- EndM
- ELSE
- IMPORT_CFM_FUNCTION RestoreBack
- ENDIF
-
- ;
- ; pascal OSErr SetDepth(GDHandle gd, short depth, short whichFlags, short flags)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SetDepth
- move.w #$0A13,D0
- dc.w $AAA2
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SetDepth
- ENDIF
-
- ;
- ; pascal short HasDepth(GDHandle gd, short depth, short whichFlags, short flags)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _HasDepth
- move.w #$0A14,D0
- dc.w $AAA2
- EndM
- ELSE
- IMPORT_CFM_FUNCTION HasDepth
- ENDIF
-
- ;
- ; pascal short PMgrVersion(void )
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _PMgrVersion
- moveq #21,D0
- dc.w $AAA2
- EndM
- ELSE
- IMPORT_CFM_FUNCTION PMgrVersion
- ENDIF
-
- ;
- ; pascal void SetPaletteUpdates(PaletteHandle p, short updates)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _SetPaletteUpdates
- move.w #$0616,D0
- dc.w $AAA2
- EndM
- ELSE
- IMPORT_CFM_FUNCTION SetPaletteUpdates
- ENDIF
-
- ;
- ; pascal short GetPaletteUpdates(PaletteHandle p)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetPaletteUpdates
- move.w #$0417,D0
- dc.w $AAA2
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetPaletteUpdates
- ENDIF
-
- ;
- ; pascal Boolean GetGray(GDHandle device, const RGBColor *backGround, RGBColor *foreGround)
- ;
- IF ¬ GENERATINGCFM THEN
- Macro
- _GetGray
- move.w #$0C19,D0
- dc.w $AAA2
- EndM
- ELSE
- IMPORT_CFM_FUNCTION GetGray
- ENDIF
-
- ENDIF
- ENDIF ; __PALETTES__
-
-